package mr.zhang.controller;

import mr.zhang.service.TestMyBatisService;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



public class DeleteMerchantController extends AbstractController {
	
	private TestMyBatisService testMyBatisService;
	
	

	public TestMyBatisService getTestMyBatisService() {
		return testMyBatisService;
	}



	public void setTestMyBatisService(TestMyBatisService testMyBatisService) {
		this.testMyBatisService = testMyBatisService;
	}



	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		
	int id = Integer.parseInt(request.getParameter("id"));
	
	
		
		this.testMyBatisService.deleteMerchant(id);
		
		return new ModelAndView("redirect:/queryMerchant.do");
	}



}
